// 引入二次封装的axios
import request from '@/utils/request'
// 引入ts接口
import type {
  loginFormData,
  loginResponseData,
  userInfoResponseData,
} from './type'
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USER_INFO = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}

//登录接口
export const reqLogin = (data: loginFormData) =>
  request.post<any, loginResponseData>(API.LOGIN_URL, data)
//获取用户信息接口
export const reqUserInfo = () =>
  request.get<any, userInfoResponseData>(API.USER_INFO)
//退出登录接口
export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL)
